{% extends 'layout.html' %}

{% load common %}

{% block content %}
    <a href="{% url 'level_add' %}" class="btn btn-primary" style="margin-bottom: 5px">新增</a>

    <table class="table table-bordered">
        <thead>
        <tr>
            <th>ID</th>
            <th>标题</th>
            <th>折扣</th>
            <th>选项</th>
        </tr>
        </thead>
        <tbody>
        {% for obj in pager.get_queryset %}
            <tr>
                <td>{% forloop_counter request forloop.counter %}</td>
                <td>{{ obj.title }}</td>
                <td>{{ obj.percent }}%</td>
                <td>
                    <a href="{% url_plus request 'level_edit' uid=obj.id %}" class="btn btn-success btn-xs">编辑</a>
                    <a href="{% url_plus request 'level_delete' uid=obj.id %}" class="btn btn-danger btn-xs">删除</a>
                </td>
            </tr>
        {% endfor %}
        </tbody>
    </table>

    {{ pager.gen_html }}
{% endblock %}